home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 419 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.6 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 16 Aug 93 10:38:39 +0200
  3. Message-Id: <9308160838.AA13786@issan.informatik.uni-dortmund.de>
  4. To: reschke@goedel.uni-muenster.de
  5. In-Reply-To: <9308141415.AA16895@math.uni-muenster.de> (message from Julian Reschke on Sat, 14 Aug 93 16:15:54 MET DST)
  6. Subject: Re: 1.08, Pexec mode 200
  7.  
  8. >>>>> Julian Reschke <reschke@GOEDEL.UNI-MUENSTER.DE> writes:
  9. |>  Hi,
  10.  
  11. |>  with 1.08, Pexec mode 200 reliably crashes on my system (just try something
  12. |>  like Pexec (200, filename, "", 0L); -> memory violation). It seems that
  13. |>  the new process tries to access either the basepage or the environment
  14. |>  and crashes. Turning of MP cures that.
  15.  
  16. |>  Any help appreciated.
  17.  
  18. Here is a patch:
  19.  
  20. --- orig/dosmem.c    Thu Aug  5 19:09:54 1993
  21. +++ ./dosmem.c    Sat Aug 14 02:33:32 1993
  22. @@ -558,6 +558,32 @@
  23.              if (xattr.mode & S_ISGID)
  24.                  p->egid = xattr.gid;
  25.          }
  26. +
  27. +    /* jr: add Pexec information to PROC struct */
  28. +    p->cmdlin[0] = 0;
  29. +    if (mkbase || mkload)
  30. +        strncpy(p->cmdlin, ptr2, 128);
  31. +    p->fname[0] = 0;
  32. +    if (mkload)
  33. +    {
  34. +        char tmp[PATH_MAX];
  35. +        char *source = ptr1;
  36. +        tmp[1] = ':';
  37. +        if (source[1] == ':') {
  38. +            tmp[0] = source[0];
  39. +            source += 2;
  40. +        } else
  41. +            tmp[0] = 'A' + curproc->curdrv;
  42. +        if (DIRSEP(source[0]))    /* absolute path? */
  43. +        {
  44. +            strncpy (&tmp[2], &source[0], PATH_MAX-2);
  45. +            strcpy (p->fname, tmp);
  46. +        } else {
  47. +            if (! d_getcwd (&tmp[2], tmp[0] - 'A' + 1, PATH_MAX - 2))
  48. +                ksprintf (p->fname, "%s\\%s", tmp, source);
  49. +        }
  50. +    }
  51. +
  52.      /* exec_region frees the memory attached to p; that's always what
  53.       * we want, since fork_proc duplicates the memory, and since
  54.       * if we didn't call fork_proc then we're overlaying.
  55. @@ -588,31 +614,6 @@
  56.          if (p->ptracer)
  57.              p->ctxt[CURRENT].ptrace = 1;
  58.  
  59. -    /* jr: add Pexec information to PROC struct */
  60. -    p->cmdlin[0] = 0;
  61. -    if (mkbase || mkload)
  62. -        strncpy(p->cmdlin, ptr2, 128);
  63. -    p->fname[0] = 0;
  64. -    if (mkload)
  65. -    {
  66. -        char tmp[PATH_MAX];
  67. -        char *source = ptr1;
  68. -        tmp[1] = ':';
  69. -        if (source[1] == ':') {
  70. -            tmp[0] = source[0];
  71. -            source += 2;
  72. -        } else
  73. -            tmp[0] = 'A' + curproc->curdrv;
  74. -        if (DIRSEP(source[0]))    /* absolute path? */
  75. -        {
  76. -            strncpy (&tmp[2], &source[0], PATH_MAX-2);
  77. -            strcpy (p->fname, tmp);
  78. -        } else {
  79. -            if (! d_getcwd (&tmp[2], tmp[0] - 'A' + 1, PATH_MAX - 2))
  80. -                ksprintf (p->fname, "%s\\%s", tmp, source);
  81. -        }
  82. -    }
  83. -
  84.      /* set the time/date stamp of u:\proc */
  85.          proctime = timestamp;
  86.          procdate = datestamp;
  87.  
  88. ----------------------------------------------------------------------
  89. Andreas Schwab                                  "And now for something
  90. schwab@ls5.informatik.uni-dortmund.de            completely different"
  91.